<?
	/* View */
	define('PS', 1);
	include_once("../../defines.php");
	
	include_once('header.php');

	$PageName = 'tagsSearchResult';
	include_once(PUBLIC_BEHIND_DIRECTORY . $PageName . '.php');
?>
<script type="text/javascript">
	$(function(){
		$(".interview").click(function(){
			ajaxParams = {
				pageToLoad : "<?=PUBLIC_VIEWS_PATH . 'news.php';?>",
				parameters : { NewsId :  $(this).data("id") }
			};
			functions.loadSubPage(ajaxParams);
		});
	});
</script>

<div id="contactContent" class="centerContent">
	<h1 class="titlePage">Tags buscados: <?= $_REQUEST["tags"];?></h1>
	<?
	if (count($NewsWithTag) > 0){
	?>
	<div id="interviews">
	<?
	$counter = 0;
	foreach ($NewsWithTag as $News){
		$arrImage = $News->getImage();
		$Image = MAIN_IMAGES_NEWS_DIRECTORY . $arrImage[0]['name_file'];
		if (!file_exists($Image))
			$Image = NO_IMAGE;
		else 
			$Image = MAIN_IMAGES_NEWS_PATH . $arrImage[0]['name_file'];
		$counter++;
	?>
		<div class="interview" data-id="<?= $News->getId();?>">
			<span class="styleNews"><?= $News->getTypeInSpanish() . '<br />';?></span>
			<img src="<?= PUBLIC_IMAGES_PATH;?>arrow.png" alt="arrow" /><span class="title"><?= $News->getTitle(); ?></span>
			<span class="date"><?= 'Fecha: ' . date('d/m/Y', strtotime($News->getCreated())) . '<br />Por: ' . $News->getUser()->getWholeName();?></span>
	<?
		if (!empty($Image))
			echo '<br /><img src="' . $Image . '" class="miniPicNews" />';
	?>
			<div class="clear"></div>
			<br />
		</div>
	<?
		if ($counter != count($NewsWithTag))
			echo '<hr />';
	?>
	<?
	} 	
	?>
	</div>
	<?
	}else{
		echo '<span class="centerContent bold empty">' . $messages->getMessage("NotInformationToShow") . '</span><br />';
	}
	?>

</div>

<? include('footer.php'); ?>